<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/8/31 23:38
 */

namespace module\user\event;

use module\user\middleware\AuthTokenMiddleware;
use module\user\middleware\NeedLoginMiddleware;

class HttpRun
{
    public function handle(): void
    {
        //定义中间剪别名
        $middleware = app('config')->get('middleware');
        $middleware['alias']['user:auth'] = AuthTokenMiddleware::class;
        $middleware['alias']['user:login'] = NeedLoginMiddleware::class;
        //写入配置
        app('config')->set($middleware, 'middleware');
    }
}